#include "HomePage.h"
#include "SettingPage.h"
#include "../widgets/panel/CheckOut/CheckoutPanel.h"
#include "../widgets/panel/CheckIn/CheckInPanel.h"
#include "../widgets/panel/HeartbeatDetection/HeartbeatPanel.h"
#include "../widgets/panel/MatchProcParamCollect/MatchProcParamCollectPanel.h"
#include "../widgets/panel/AlarmReport/MachAlarmReportPanel.h"
#include <QStackedWidget>
#include <QGridLayout>
#include <QGroupBox>

HomePage::HomePage(QWidget *parent)
    : QWidget{parent}
{
    setupUi();
}

void HomePage::initWidgets()
{
    const auto settingPage = new SettingPage();
    const auto gridLayout = new QGridLayout();


    const auto checkOutPanel = new CheckoutPanel();
    const auto checkInPanel = new CheckInPanel();
    const auto heartbeatPanel = new HeartbeatPanel();
    const auto matchProcParamCollectPanel = new MatchProcParamCollectPanel();
    const auto alaramReportPanel = new MachAlarmReportPanel();

    gridLayout->addWidget(settingPage,0,0,1,1);
    gridLayout->addWidget(checkInPanel,1,0,1,1);
    gridLayout->addWidget(checkOutPanel,1,1,1,1);
    gridLayout->addWidget(heartbeatPanel,1,2,1,1);
    gridLayout->addWidget(matchProcParamCollectPanel,1,3,1,1);
    gridLayout->addWidget(alaramReportPanel,1,4,1,1);


    setLayout(gridLayout);
}

void HomePage::setupUi()
{
    initWidgets();
}
